{% extends 'TopxiaWebBundle:Settings:layout.html.twig' %}
{% block title %}安全设置 - {{ parent() }}{% endblock %}
{# {% set script_controller = 'settings/security' %}  #}
{% set side_nav = 'security' %} 

{% block main %} 
 {% embed "TopxiaWebBundle:Bootstrap:panel.html.twig" with {class:'panel-col'} %}
    {% block heading %}安全设置{% endblock %}
    {% block body %}
    {{ web_macro.flash_messages() }}
    
      <div class="row safety-setting">
        <div class="col-xs-2 tar">
          <span class="esicon esicon-safety {% if progressScore > 90 %}text-success{% elseif progressScore > 60 %}text-warning{% else %}text-danger{% endif %}" style="font-size:20px"></span>
        </div>
      <div class="col-sm-6 col-xs-5">
        <div class="progress" style="margin-top:5px;">
          <div class="progress-bar" role="progressbar" style="width: {{ progressScore }}%;"></div>
        </div>
      </div>
      <div class="col-sm-4 col-xs-5">
        {% if progressScore > 80 %}
          <span class="text-success" style="display:block;margin-top:5px;">安全等级：高</span>
        {% elseif progressScore > 30 %}
        <span class="text-warning" style="display:block;margin-top:5px;">安全等级：中</span>
        {% else %}
          <span class="text-danger" style="display:block;margin-top:5px;">安全等级：低</span>
        {% endif %}
      </div>
    </div>

    <hr>
    
    <div class="row">
      <div class="col-xs-2 tar
        {% if hasLoginPassword %} 
          text-success
        {% else %}
          text-danger
        {% endif %}
      " style="font-size:20px">
        {% if hasLoginPassword %} 
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >登录密码</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >登录网校时需要输入的密码</span>

      <a href="{{ path('settings_password') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >修改</a>
    </div>
    <hr>

    <div class="row">
      <div class="col-xs-2 tar
        {% if hasPayPassword %} 
          text-success
        {% else %}
          text-danger
        {% endif %}
      " style="font-size:20px">
        {% if hasPayPassword %} 
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >支付密码</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >在网校进行消费行为时需要输入的密码</span>

      {% if hasPayPassword %} 
        <a href="{{ path('settings_reset_pay_password') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >重置</a>   
      {% else %}
        <a href="{{ path('settings_pay_password') }}" class="col-xs-offset-1  btn btn-primary" style="margin-top: -3px;" >设置</a>
      {% endif %}
      
    </div>
    <hr>
      
    <div class="row">
      <div class="col-xs-2 tar
        {% if hasFindPayPasswordQuestion %} 
          text-success
        {% else %}
          text-danger
        {% endif %} " 
        style="font-size:20px">
      
        {% if hasFindPayPasswordQuestion %} 
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >安全问题</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >通过设置并且验证安全问题，保护帐号密码安全。</span>

      <a href="{{ path('settings_security_questions') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >
      {% if hasFindPayPasswordQuestion %}
        查看
      {% else %}
        设置
      {% endif %}

      </a>
    </div>

    {% if (setting('cloud_sms.sms_enabled')|default('')) == '1' and (setting('cloud_sms.sms_bind')|default('')) == 'on' %}
      <hr>
        
      <div class="row">
        <div class="col-xs-2 tar
          {% if hasVerifiedMobile %} 
            text-success
          {% else %}
            text-danger
          {% endif %} " 
          style="font-size:20px">
        
          {% if hasVerifiedMobile %} 
            <span class="glyphicon glyphicon-ok"></span>
          {% else %}
            <span class="glyphicon glyphicon-warning-sign"></span>
          {% endif %}
        </div>

        <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >手机绑定</span>

        <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >增加账户登录、购买课程时的安全性，同时还可以找回登录密码，支付密码。</span>

        <a href="{{ path('settings_bind_mobile') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >
        {% if hasVerifiedMobile %}
          修改
        {% else %}
          绑定
        {% endif %}
        </a>
      </div>
    {% endif %}

    {% endblock %}
  {% endembed %}
{% endblock %}